import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';

import { AppComponent } from './app.component';
import { GifComponent } from './gif/gif.component';
import { GiflistComponent } from './giflist/giflist.component';
import { PublishgifComponent } from './publishgif/publishgif.component';
import { TabbarComponent } from './tabbar/tabbar.component';
import { VideoComponent } from './video/video.component';
import { PhotoComponent } from './photo/photo.component';

const routes: Routes = [
  { path: '', redirectTo: 'gif', pathMatch: 'full' },
  { path: 'gif', component: GiflistComponent },
  { path: 'video', component: VideoComponent },
  { path: 'photo', component: PhotoComponent },
];

@NgModule({
  declarations: [
    AppComponent,
    GifComponent,
    GiflistComponent,
    PublishgifComponent,
    TabbarComponent,
    VideoComponent,
    PhotoComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(routes) // <-- routes
  ],
  providers: [

  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
